class FirstPage extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            list: [
                { ismode: 1 },
            ],
            thumburl: '',
            name: '',
            fangjianhtml: [],
            input_name: '',
            sdarr: [],
            mbkjlist: [

            ],//模板空间
            id: '0',
            partcount: 1,
            parts: [{ src: '' }, { src: '' }, { src: '' }],
            categorylist: [],
            select_swiperlink: { name: '请选择' },
            swiperimglist: [],
            input_mbname: '模板房间',
            category_select_list: [],
            recommendtablehtml: [],
            recommendlist: [],
            detail: { id: -1, name: '' },
            goods_select_html: [],
            currentswipertype: 0,
            swiperlinkhtml: [],
            swipertablehtml: [],
            swiperimghtml: [],
            subtitle: '',
            totalamount: 0,
            showmoban: !1,
            data:{
                items:{
                    cp:[{ count: 0, type:'CP', id: 0, width: 0, height: 0, deep: 0, singleprice: 0 }]
                    ,wj:[{ count: 0, type:'WJ', id: 0, width: 0, height: 0, deep: 0, singleprice: 0 }]
                },amount:0},
            moban: {
                cp: [
                    { width: 0, height: 0, deep: 0, singleprice: 0 }
                ],
                wj: [
                    { count: 0, singleprice: 0 }

                ],
                name: '',
                amount: 0
            },
            exportlist: [

            ],
            // exportlist1:[
            //     {
            //         room:{
            //             name:'',
            //             id:''
            //         },
            //         wjtotal:0,
            //         cptotal:0,
            //         cptotalcount:0,
            //         amount:0,
            //         wj:[{
            //             pid: '',
            //             cid: '-1',
            //             cid1: '-1',
            //             cname: '',
            //             height: "",
            //             width: "",
            //             deep: "",
            //             singleprice: 0,
            //             count: '',
            //             amount: '',
            //             unit: '',
            //             lmsm: '',
            //             mbcz: '',
            //             gtcz: '',
            //         }

            //         ],
            //         cp:[
            //             {
            //                 pid: '',
            //                 cid: '-1',
            //                 cid1: '-1',
            //                 cname: '',
            //                 height: "",
            //                 width: "",
            //                 deep: "",
            //                 singleprice: 0,
            //                 count: '',
            //                 amount: '',
            //                 unit: '',
            //                 lmsm: '',
            //                 mbcz: '',
            //                 gtcz: '',

            //             }
            //         ]
            //     }
            // ],
            swiper: {
                imgs: [],
                links: []
            },
            fileimgshow: !0,
            imgstate: '',
            imgsrc: '',
            to: '',
        };
    }

    // formatlist(data) {
    //     console.log('format-=-data',data);

    //     // list.forEach((x, i) => {
    //     //     if (!x.items['cp']) {
    //     //         // console.log("x.items['cp']");
    //     //         let items = {}
    //     //         items['cp'] = x.items.filter(x => { return x.type == 'CP' })
    //     //         items['wj'] = x.items.filter(x => { return x.type == 'WJ' })
    //     //         list[i]['items'] = items
    //     //     }
    //     // })
    //     // console.log(list, 'format--list');
    //      this.setState({ data: list })
    // }


    getxs(deep) {
        let xs = 1;
        this.state.sdarr.forEach(x => {
            if (deep > x.min && deep <= x.max) xs = x.number
        })
        return xs
    }


    componentDidMount() {
        let id = GetQueryString('id'), totalamount = 0, fangjianhtml = []

        //     dz_getcategorylist('XSSD',res=>{
        //         if(res.issuccess==1){
        //             this.setState({sdarr:res.list})
        //     }
        //  })

        // if(id=='null'){
        //     this.addmoban()
        // }
    

        dz_categetlist(res => {
            if (res.issuccess == 1) {
                let { list } = res

                let cate_CPLBhtml = [], cate_GTCZhtml = [], cate_WJLBhtml = [], cate_WJCZhtml = [];
                let list_CPLB = list.filter(x => x.type == 'CPLB').reverse()
                let list_GTCZ = list.filter(x => x.type == 'GTCZ').reverse()
                let list_WJLB = list.filter(x => x.type == 'WJLB').reverse()
                let list_WJCZ = list.filter(x => x.type == 'WJCZ').reverse()
                console.log({ list_CPLB, list_GTCZ, list_WJLB, list_WJCZ }, 'list1');

                cate_CPLBhtml.push(<option value={-1}>请选择 </option>)
                list_CPLB.forEach((x, i) => {
                    cate_CPLBhtml.push(
                        <option key={i} value={x.id}>{x.name} </option>
                    )
                })

                cate_GTCZhtml.push(<option value={-1}>请选择 </option>)
                list_GTCZ.forEach((x, i) => {
                    cate_GTCZhtml.push(
                        <option key={i} value={x.id}>{x.name} </option>
                    )
                })

                cate_WJLBhtml.push(<option value={-1}>请选择 </option>)
                list_WJLB.forEach((x, i) => {
                    cate_WJLBhtml.push(
                        <option key={i} value={x.id}>{x.name} </option>
                    )
                })

                cate_WJCZhtml.push(<option value={-1}>请选择 </option>)
                list_WJCZ.forEach((x, i) => {
                    cate_WJCZhtml.push(
                        <option key={i} value={x.id}>{x.name} </option>
                    )
                })

                // catehtml1.push(<option value={-1}>请选择</option>)
                // res.list1.forEach((x, i) => {
                //     catehtml1.push(
                //         <option key={i} value={x.id}>{x.name} </option>
                //     )
                // })
                this.setState({
                    cate_CPLBhtml, list_CPLB, cate_GTCZhtml, list_GTCZ, list_WJLB
                    , cate_WJLBhtml, cate_WJCZhtml, list_WJCZ
                })
            }
        })



        if (id != 'null') {
            this.setState({ id }, () => {

                dz_getroombyid(
                    id, res => {
                        if(res.issuccess==1){
                            let { data } = res
                            this.setState({input_name:data.name})
                            dz_getcategorylist('XSSD', res => {
                                if (res.issuccess == 1) {
                                    this.setState({ sdarr: res.list }, () => {
                                        this.setState({data:JSON.parse(decodeurl(data.rawData))})
                                        //this.formatlist()
                                    })
                                }
                            })
                        }
                      
                    }
                )






                // dz_projectdetail_getd(id, res => {
                //     let detail = res.data
                //     // console.log(uniq(res.data.roomids.split(',')),'uniq');
                //     if (detail.rawData == '') {
                //         dzroom_getlistbyid(
                //             uniq(res.data.roomids.split(',')).toString(), res => {
                //                 let { list } = res
                //                 if (list.length > 0) {
                //                     dz_getcategorylist('XSSD', res => {
                //                         if (res.issuccess == 1) {
                //                             this.setState({ sdarr: res.list, input_name: res.name }, () => {
                //                                 this.formatlist(list)
                //                             })
                //                         }
                //                     })
                //                 }
                //             }
                //         )
                //     } else {
                //         // console.log(),'0000');
                //         let exportlist = JSON.parse(decodeurl(res.data.rawData))
                //         console.log(exportlist, 'listlist123');
                //         this.formatlist(exportlist)

                //         this.setState({ input_name: detail.name })

                //     }
                // })
            })
        }

        //  $('.modal1').hide()

        // this.freshlist()

    }
    freshlist() {
        dzroom_getlist(res => {
            if (res.issuccess == 1) {

                // this.formatlist(res.list); 
                let roomhtml = [];
                roomhtml.push(<option value={-1}>请选择 </option>)
                res.list.forEach(x => {
                    roomhtml.push(
                        <option value={x.id}>{x.name} </option>
                    )
                })

                this.setState({ list: res.list, roomhtml })

                console.log(res.list)
            }
        })




    }





    /**新建 */
    add() {
        // $('.modal1').show()
        var name = prompt('请输入房间名称')
        if (name != '') {
            aoedzroom({ name }, res => {
                if (res.issuccess == 1) {
                    this.freshlist()
                } else {
                    alert(res.msg)
                }
            })
        }
    }


    // 编辑
    edit(x) {
        var name = prompt('请编辑房间名称', x.name)
        if (name != '' && name != x.name) {
            //  console.log(name,'name');

            dz_projectdetail_add({ id: x.id, name }, res => {
                if (res.issuccess == 1) {
                    //   alert('修改成功')
                    this.freshlist()
                } else {
                    alert(res.msg)
                }
            })
        }

        // 
    }
   

    addline( type) { 
        if (this.state.input_name == '') {
            alert('请输入房间名称')
        } else {
            let { data } = this.state
            console.log(data,'addline --data');
            data['items'][type].push({ count: 0, type, id: 0, width: 0, height: 0, deep: 0, singleprice: 0 })
              this.setState({data})
            this.save(data)
        }
    }

    removeline(i, t) {
      //  console.log({ i, t }, 'removeline');
        let { data } = this.state, items = data['items'][t];
        if (items.length == 1) {
            items.push({ count: 0, type: t, id: 0, width: 0, height: 0, deep: 0, singleprice: 0 })
        } else {
            items.splice(i, 1)
        }
        data['items'][t]= items
         this.setState({data})
        this.save(data)

        //每次删除都要重新设置一边oindex


        //    let list = this.state.exportlist[i]['items'].filter(x=>{return x.type==t})
        //   //  let {moban} = this.state

        //     if(e==0){
        //         moban.cp.splice(i,1)
        //     }else{
        //         moban.wj.splice(i,1)
        //     }
        //     // let {moban} = this.state,data = [{}]
        //     // moban[`${e==0?'cp':'wj'}`].push(data)
        //      this.setState({moban})
    }




    // 删除
    del(e, cid) {
        this.setState({ delid: e, newcid: cid }, () => {
            $('#myModal').modal('toggle');
        })
    }

    // delroom(index) {
    //     var b = confirm('确定要删除房间吗')
    //     if (b) {
    //         let { exportlist } = this.state
    //         exportlist.splice(index, 1)
    //         this.setState({ exportlist })
    //     }
    // }



    confirmdel() {
        let { delid, start } = this.state
        delimg(delid, res => {
            if (res.issuccess == 1) {
                //  alert('删除成功')
                $('#myModal').modal('toggle');
                this.freshlist(start)
            } else {
                $('#myModal').modal('toggle');
                alert(res.msg);
            }
        })
    }

    closemodal() {
        $('.modal1').hide()
    }

    inputchange(prop, e) {
        this.setState({ [prop]: e.target.value })
    }
    confirm() {
        let { name, subtitle } = this.state, err = '';
        if (name.length == 0) err = '请输入名称'
        dz_project_aoe({ name, subtitle }, res => {
            $('.modal1').hide()
            if (res.issuccess == 1) {
                //   alert('提交成功')
                this.freshlist()
            }
        })
    }

  

    // selectchange(e){
    //     this.setState({selectroomid:e.target.value})
    // }

    selectchange( tname, index, e) {
        //  if(this.state.detail.pool!='BJ') return
        let { value } = e.target, { data } = this.state,list = tname == 'cp' ? this.state.list_GTCZ : this.state.list_WJLB, item = list.find(x => x.id == value)
        // if (id > 0) {
        //     i = exportlist[ei]['items'].findIndex(x => { return x.id == id })
        // } else {
        //     //自定义里的 
        //     // if(t=='WJLB'){
        //     //     index+=exportlist[ei]['items'].filter(x=>{return x.type=='CP'}).length
        //     // }
        //     i = exportlist[ei]['items'].findIndex(x => { return x.oindex == index })
        // }
        //console.log(i, 'selectchange--i');
        data['items'][tname][index]['cid1'] = item.id;
        data['items'][tname][index]['type'] = tname
        data['items'][tname][index]['cname1'] = item.name;
        data['items'][tname][index]['singleprice'] = item.price;
        data['items'][tname][index]['unit'] = item.unit;
        this.setState({ data }, () => {
            this.save(data)
        })
    }
    savemoban() {
        let { input_name } = this.state
        if (input_name == '') {
            alert('请输入业主地址')
            return
        } else {
            let { moban, exportlist } = this.state, data = {
                name: this.state.input_mbname,
                items: {
                    cp: [{ width: 0, height: 0, deep: 0, singleprice: 0 }]
                    , wj: [{ count: 0, singleprice: 0 }]
                }
            }
            exportlist.push(data)
            this.save(exportlist)


            this.setState({
                exportlist, moban: {
                    cp: [
                        { width: 0, height: 0, deep: 0, singleprice: 0 }
                    ],
                    wj: [
                        { count: 0, singleprice: 0 }

                    ],
                    name: '',
                    amount: 0
                }
            })
        }
    }


    save(data) {
        let { id, input_name } = this.state;
        if (input_name == '') {
            alert('请输入房间名称')
        } else {
            let senddata = { name: input_name, data: JSON.stringify(data) }
            if (Number(id) > 0) senddata['id'] = id
            dz_roomupdatedata(senddata, res => {
                if (res.issuccess == 1) {
                    if (Number(id) > 0){
                    }else{
                        this.setState({ id: res.id })
                    }
                   // this.setState({data})
                   
                    //alert('保存成功')
                    // if(ismoban){
                    //     window.location.href='./dz_newroom.html?id='+res.id
                    // }
                }
            })
        }

    }

    inputchange1(prop, val, tdindex,type) {
        // if(this.state.detail.pool!='BJ') return
        //this.inputchange1.bind(this, item_cp.id, 'count', item_cp.count, i, 'wj')
            var value = prompt('请输入')
              console.log('inputchange1', { prop, val, tdindex,type});
              if (value != val && value != '' && value != null) {

                if(this.state.input_name==''){
                    alert('请输入房间名称')
                }else{
                    let { data } = this.state
                    console.log(data,'datadatadata');
                    data.items[type][tdindex][prop] = value
                    this.save(data)
                    this.setState({ data })
                }
              }


     
    }

    // inputmobanchange1(prop, t, index, val) {

    //     // if(this.state.detail.pool!='BJ') return
    //     var value = prompt('请输入', val), { moban } = this.state
    //     if (value != val && value != '') {
    //         let tval = t == 0 ? 'cp' : 'wj'
    //         moban[tval][index][prop] = value;
    //         //  let {exportlist} = this.state,index = exportlist[eindex]['items'].findIndex(x=>{return x.id==id})
    //         this.setState({ moban })
    //     }
    // }




    selectfang(e) {
        console.log(e.target.value, 'edddd');
        let sel_fang = e.target.value
        this.setState({ sel_fang })
    }

    addfangjian() {
        let { sel_fang, exportlist } = this.state;
        dzroom_getlistbyid(sel_fang, res => {
            let { list } = res
            if (list.length > 0) {
                list.forEach(item => {
                    let cptotalcount = 0, cptotal = 0, wjtotal = 0;
                    item.items.forEach(x => {
                        if (x.type == 'CP') {
                            cptotalcount += Number(x.count)
                            cptotal += (Number(x.count) * Number(x.singleprice))
                        } else {
                            wjtotal += (Number(x.count) * Number(x.singleprice))
                        }
                    })
                    item['cptotalcount'] = Number(cptotalcount).toFixed(2)
                    item['cptotal'] = Number(cptotal).toFixed(2)
                    item['wjtotal'] = Number(wjtotal).toFixed(2)
                    item['amount'] = (Number(wjtotal) + Number(cptotal)).toFixed(2)
                    //  totalamount+=Number(wjtotal)+Number(cptotal)
                    exportlist.push(item)
                })

                console.log(exportlist, 'addfangjian');

                this.setState({ exportlist })

            }
        })
    }




    render() {
        var {data, input_name, sel_fang, fangjianhtml, moban, showmoban, input_mbname, detail, name, exportlist, totalamount, cate_WJLBhtml, roomhtml, selectroomid, cate_GTCZhtml } = this.state;
        console.log(moban, 'moban');

        let moban_amount = 0;
        moban.cp.forEach(x => {
            moban_amount += Math.round(((Number(x.height) * Number(x.width)) / 1000000) * Number(x.singleprice))
        })
        moban.wj.forEach(x => {
            moban_amount += Math.round(Number(x.count) * Number(x.singleprice))
        })
        moban.amount = moban_amount
        console.log(exportlist, 'exportlistexportlist');

        // if (exportlist.length > 0) {
        //     exportlist.forEach(item => {
        //         let cptotalcount = 0, cptotal = 0, wjtotal = 0;
        //         item.items.cp.forEach(x => {
        //             x.count = (x.unit == '米' ? (Number(x.deep) / 1000) : ((Number(x.height) * Number(x.width)) / 1000000)) * this.getxs(x.deep)
        //             cptotalcount += Number(x.count)
        //             cptotal = Math.round(Number(cptotal) + (Number(x.count) * Number(x.singleprice)))
        //         })
        //         item.items.cp.forEach(x => {
        //             wjtotal = Math.round(Number(wjtotal) + (Number(x.count) * Number(x.singleprice)))
        //         })
        //         item['cptotalcount'] = Number(cptotalcount).toFixed(2)
        //         item['cptotal'] = cptotal
        //         item['wjtotal'] = wjtotal
        //         item['amount'] = Math.round(Number(wjtotal) + Number(cptotal))
        //         totalamount = Math.round(Number(totalamount) + Number(wjtotal) + Number(cptotal))
        //     })
        // }
        return (

            <div className="breadLinebox">

                <div className="content">
                    <input placeholder="请输入房间名称" allowClear value={input_name} onChange={this.inputchange.bind(this, 'input_name')} className="input" />
                </div>

            

                <div className='content_wrap panel-default content_wrap'>

                    <div className="content form">
                        {/* <div style={{display:clicknew?"":"none"}} id="div"> */}
                        <div className="titlet">{this.state.detail.name}</div>
                        {
                             <div>

                             <div className="content form">
                               
                                 <table className="tab">
                                     <thead>
                                         <tr>
                                             {/* <th className="minwidth tconter"><img src="./src/notselection.png"/></th> */}

                                             <th className="tconter">序号</th>
                                             <th className="tconter w80">产品类型</th>
                                             <th className="cz tconter">宽度</th>
                                             <th className="tconter">高度</th>
                                             <th className="cz tconter">深度</th>
                                             <th className="cz tconter">数量</th>
                                             <th className="cz tconter">单位</th>
                                             <th className="cz tconter">单价</th>
                                             <th className="cz tconter">总价</th>
                                             <th className="cz tconter w80">立面说明</th>
                                             <th className="cz tconter w80">门板/柜体材质</th>
                                             <th className="cz tconter">操作</th>
                                         </tr>
                                     </thead>
                                     <tbody>
                                         {

                                             data.items.cp.map((item_cp, index) => {
                                                let xs = this.getxs(item_cp.deep)
                                                console.log(xs,'xsxs');
                                                 let count = (item_cp.unit == '米' ? (Number(item_cp.width) / 1000) : ((Number(item_cp.height) * Number(item_cp.width)) / 1000000)) * xs

                                                 return ( 
                                                     <tr key={index}>
                                                         {/* <td className="minwidth tconter"><img src="./src/notselection.png"/></td>  */}
                                                         {/* <td className="tconter">{x.state=="0"?"显示":"隐藏"}</td>  */}
                                                         <td className="tconter">{index + 1}</td> 
                                                         <td onClick={this.inputchange1.bind(this,'cname', item_cp.cname, index,'cp')} className="tconter w80">
                                                             {item_cp.cname}
                                                         </td>
                                                         <td onClick={this.inputchange1.bind(this,  'width', item_cp.width, index,'cp')} className="tconter">{item_cp.width}</td>
                                                         <td onClick={this.inputchange1.bind(this,  'height', item_cp.height, index,'cp')} className="tconter">{item_cp.height}</td>
                                                         <td onClick={this.inputchange1.bind(this,  'deep', item_cp.deep, index,'cp')} className="tconter">{item_cp.deep}</td>
                                                         <td className="tconter">{
                                                             count.toFixed(2)}</td>
                                                         <td className="tconter">{item_cp.unit}</td>
                                                         <td onClick={this.inputchange1.bind(this, 'singleprice', item_cp.singleprice, index,'cp')} className="tconter">{item_cp.singleprice}</td>
                                                         <td className="tconter">{Math.round(Number(item_cp.singleprice) * count)}</td>
                                                         <td onClick={this.inputchange1.bind(this, 'lmsm', item_cp.lmsm, index,'cp')} className="tconter w80">{item_cp.lmsm}</td>
                                                         {/* <td className="tconter w80"> {item_cp.cname1}</td> */}
                                                         <td className="tconter">
                                                             <select value={item_cp.cid1} onChange={this.selectchange.bind(this, 'cp',index)}>  {cate_GTCZhtml} </select>
                                                         </td>
                                                         <td className="tconter w80 btn ">
                                                             <p onClick={this.addline.bind(this, 'cp')}>添加一行</p>
                                                             <p onClick={this.removeline.bind(this, index, 'cp')}>移除</p>
                                                         </td>

                                                     </tr>
                                                 )

                                             })
                                         }
                                     </tbody>
                                 </table>
                                 {/* <div className="tongji">
                                     <div>
                                     <p> 数量合计：{x.cptotalcount}</p>
                                     <p> 合计：{x.cptotal}</p>
                                     </div>
                                         
                                    
                                 </div> */}


                                 <table className="tab">
                                     <thead>
                                         <tr>
                                             {/* <th className="minwidth tconter"><img src="./src/notselection.png"/></th> */}

                                             <th className="tconter">序号</th>
                                             <th className="tconter w80">五金类别</th>
                                             <th className="cz tconter">宽度</th>
                                             <th className="tconter">高度</th>
                                             <th className="cz tconter">深度</th>
                                             <th className="cz tconter">数量</th>
                                             <th className="cz tconter">单位</th>
                                             <th className="cz tconter">单价</th>
                                             <th className="cz tconter">总价</th>
                                             <th className="cz tconter w 80">立面说明</th>
                                             <th className="cz tconter w80" >备注</th>
                                             <th className="cz tconter">操作</th>
                                         </tr>
                                     </thead>
                                     <tbody>
                                         {
                                             data.items.wj.map((item_cp, i) => {
                                                 return (
                                                     <tr key={i}>
                                                         {/* <td className="minwidth tconter"><img src="./src/notselection.png"/></td>  */}
                                                         {/* <td className="tconter">{x.state=="0"?"显示":"隐藏"}</td>  */}
                                                         <td className="tconter">{i + 1}</td>
                                                         {/* <td className="tconter w80">
                                                         {item_cp.cname1}
                                                         </td> */}
                                                         <td className="tconter">
                                                             <select value={item_cp.cid1} onChange={this.selectchange.bind(this, 'wj', i)}>  {cate_WJLBhtml} </select>

                                                         </td>
                                                         <td className="tconter">-</td>
                                                         <td className="tconter">-</td>
                                                         <td className="tconter">-</td>
                                                         <td onClick={this.inputchange1.bind(this, 'count', item_cp.count, i, 'wj')} className="tconter">{item_cp.count}</td>
                                                         <td className="tconter">{item_cp.unit}</td>
                                                         <td onClick={this.inputchange1.bind(this, 'singleprice', item_cp.singleprice, i, 'wj')} className="tconter">{item_cp.singleprice}</td>
                                                         <td className="tconter">{Math.round(Number(item_cp.singleprice) * Number(item_cp.count))}</td>
                                                         <td onClick={this.inputchange1.bind(this, 'lmsm', item_cp.lmsm, i, 'wj')} className="tconter w80">{item_cp.lmsm}</td>
                                                         <td className="tconter w80"> {item_cp.cname}</td>
                                                         <td className="tconter w80 btn ">
                                                             <p onClick={this.addline.bind(this, 'wj')}>添加一行</p>
                                                             <p onClick={this.removeline.bind(this, i, 'wj')}>移除</p>
                                                         </td>
                                                     </tr>
                                                 )

                                             })
                                         }
                                     </tbody>
                                 </table>
                                 {/* <div className="tongji">
                                     <div>
                                     <p> 合计：{x.wjtotal}</p>
                                     </div>

                                 </div> */}
                                 <div className="tongji he">
                                     <p>合计金额：{data.amount}</p>
                                 </div>

                             </div>
                         </div>
                        }


                        <div className="tabletit" >

                            {/* <select value={selectroomid} onChange={this.selectchange.bind(this)}>{roomhtml} </select>

    <p className="add" style={{'cursor':'pointer'}} onClick={this.addroom.bind(this)}>添加</p> */}

                            <p>总金额：{totalamount}</p>
                            <div>
                                {/* <p className="add" style={{ 'cursor': 'pointer' }} onClick={this.export.bind(this)}>导出</p> */}
                                {/* <p className="add" style={{ 'cursor': 'pointer' }} onClick={this.save.bind(this)}>保存</p> */}
                                <p className="add" style={{ 'cursor': 'pointer' }} onClick={() => { window.location.href = './dz_room.html' }}>返回</p>
                            </div>
                        </div>



                    </div>

                </div >


            </div >


        )
    }
}





ReactDOM.render(
    <div>
        {/* <LeftMenu code='0' /> */}
        <FirstPage />
    </div>
    //<Barrage/>
    , $('.container')[0]
)